<template>
  <div class="article">
    <div v-for="item of arr" :key="item" class="article-item boxDefaultStyle">
      <div v-if="item % 2 != 0" class="article-item-wrapper">
        <ArticleItemImage arrow="left" />
        <ArticleItemContent />
      </div>
      <div v-else class="article-item-wrapper">
        <ArticleItemContent />
        <ArticleItemImage arrow="right" />
      </div>
    </div>
  </div>
</template>

<script>
import ArticleItemImage from "./ArticleItemImage";
import ArticleItemContent from "./ArticleItemContent";
export default {
  name: "ArticleItem",
  components: {
    ArticleItemImage,
    ArticleItemContent,
  },
  data() {
    return {
      arr: [1, 2, 3, 4, 5],
    };
  },
};
</script>

<style lang="stylus" scoped>
@import '~$style/stylus/mixins.styl';

.article-item {
  height: 2.8rem;
}

.article-item:not(:first-child) {
  margin-top: 0.2rem;
}

.article-item:hover {
  boxHoverStyle();

  >>> img {
    transform: scale(1.1);
  }
}

.article-item-wrapper {
  height: 100%;
  display: flex;
  transition: all 1s;
}
</style>